package Greed;
//坏了得计算机
public class BrokenCalculator {
    //正难则反：除法更优
    //偶数除，奇数加
    public int brokenCalc(int startValue, int target) {
          int m=target-startValue;
          int count=0;
          while(target>startValue){
              if(target%2==0){
                  target/=2;
              }else {
                  target+=1;
              }
              count++;
          }
          return count+(startValue-target);
    }
}
